* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
}

#searchInput {
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    width: 300px;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #3498db;
}

#searchButton {
    padding: 0.8rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#searchButton:hover {
    background-color: #2980b9;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.add-button {
    padding: 0.6rem 1.2rem;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease;
}

.add-button:hover {
    background-color: #27ae60;
}

.quick-links {
    margin-bottom: 2rem;
}

.quick-links h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.quick-link {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.quick-link:hover {
    transform: scale(1.05);
}

.bookmarks-section {
    margin-top: 1rem;
}

.bookmarks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.bookmark-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.bookmark-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.bookmark-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 0.5rem;
}

.bookmark-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.bookmark-card .url {
    color: #3498db;
    font-size: 0.9rem;
    display: block;
    word-break: break-all;
}

.bookmark-card .content {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    line-height: 1.4;
    max-height: 4.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.bookmark-card .category {
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.bookmark-card .delete-bookmark,
.bookmark-card .edit-bookmark {
    position: absolute;
    top: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    color: #95a5a6;
    transition: color 0.2s ease;
}

.bookmark-card .edit-bookmark {
    right: 2.5rem;
}

.bookmark-card .delete-bookmark {
    right: 0.5rem;
}

.bookmark-card .delete-bookmark:hover {
    color: #e74c3c;
}

.bookmark-card .edit-bookmark:hover {
    color: #3498db;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px 0;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 0 auto;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background-color: white;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.4;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.submit-button {
    width: 100%;
    padding: 1rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.submit-button:hover {
    background-color: #2980b9;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .search-bar {
        width: 100%;
    }

    #searchInput {
        width: 100%;
    }

    .bookmarks-container {
        grid-template-columns: 1fr;
    }

    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        margin: 0 auto;
        width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
    }

    .bookmark-card .edit-bookmark {
        right: 3rem;
    }

    .bookmark-card .delete-bookmark {
        right: 1rem;
    }
}